import { createRouter, createWebHashHistory } from 'vue-router'

//导入组件
import buttonmy from './components/button-my.vue'
import tablemy from './components/table-my.vue'

import containermy from './components/container-my.vue'
import iconmy from './components/icon-my.vue'

import datemy from './components/date-my.vue'
import formmy from './components/form-my.vue'
import loadingmy from './components/loading-my.vue'
import tabmy from './components/tab-my.vue'
import vanswipemy from './components/van-swipe-my.vue'



//创建路由实例
const router = createRouter({
    //路由被激活时，显示的样式，可以自定义一个样式
    linkActiveClass: 'router-active',

    history: createWebHashHistory(),
    routes: [
        // 可以重定向
        { path: '/', redirect: 'buttonmy' },
        { path: '/buttonmy', component: buttonmy,name:'buttonmy'},
        { path: '/tablemy', component: tablemy,name:'tablemy'},
        { path: '/containermy', component: containermy,name:'containermy'},
        { path: '/iconmy', component: iconmy,name:'iconmy'},
        { path: '/datemy', component: datemy,name:'datemy'},
        { path: '/formmy', component: formmy,name:'formmy'},
        { path: '/loadingmy', component: loadingmy,name:'loadingmy'},
        { path: '/tabmy', component: tabmy,name:'tabmy'},
        { path: '/vanswipemy', component: vanswipemy,name:'vanswipemy'},
      
    ]
})

//懒加载的方式
//   const router = createRouter({
//     history: createWebHashHistory(),
//     routes: [
//       { path: '/home', component: () => import('./components/Home.vue') },
//       { path: '/about', component: () => import('./components/About.vue') },
//     ]
//   })


export default router;